package org.ISCS.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName dependency
 */
@TableName(value ="dependency")
@Data
public class Dependency implements Serializable {
    /**
     * docker依赖id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 依赖数据
     */
    private String dependencyData;

    /**
     * 所属服务id
     */
    private Long affiliateServiceId;

    /**
     * 依赖生成时间
     */
    private Date dependencyCreateTime;

    /**
     * 依赖生成状态
     */
    private Integer dependencyStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Dependency other = (Dependency) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDependencyData() == null ? other.getDependencyData() == null : this.getDependencyData().equals(other.getDependencyData()))
            && (this.getAffiliateServiceId() == null ? other.getAffiliateServiceId() == null : this.getAffiliateServiceId().equals(other.getAffiliateServiceId()))
            && (this.getDependencyCreateTime() == null ? other.getDependencyCreateTime() == null : this.getDependencyCreateTime().equals(other.getDependencyCreateTime()))
            && (this.getDependencyStatus() == null ? other.getDependencyStatus() == null : this.getDependencyStatus().equals(other.getDependencyStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDependencyData() == null) ? 0 : getDependencyData().hashCode());
        result = prime * result + ((getAffiliateServiceId() == null) ? 0 : getAffiliateServiceId().hashCode());
        result = prime * result + ((getDependencyCreateTime() == null) ? 0 : getDependencyCreateTime().hashCode());
        result = prime * result + ((getDependencyStatus() == null) ? 0 : getDependencyStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", dependencyData=").append(dependencyData);
        sb.append(", affiliateServiceId=").append(affiliateServiceId);
        sb.append(", dependencyCreateTime=").append(dependencyCreateTime);
        sb.append(", dependencyStatus=").append(dependencyStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}